package com.jack.topvision.tvcamera2;

import android.app.Activity;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;

import com.topvision.jack.camerasdk2.camera.callback.OnShowPhotoListener;
import com.topvision.jack.camerasdk2.camera.commom.CameraConstants;
import com.topvision.jack.camerasdk2.camera.view.TvPhotoView;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/12/26.
 */

public class ShowPhotoActivity extends Activity implements OnShowPhotoListener {
    TvPhotoView tvPhotoView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_show_photo_test);
        initView();
        Log.e("ShowVideoActivity", "onCreate");
    }

    private void initView() {
        String photo1 = Environment.getExternalStorageDirectory().getPath()+ File.separator+"topvision/a.jpg";
        String photo2 = Environment.getExternalStorageDirectory().getPath()+ File.separator+"topvision/b.jpg";
        String photo3 = Environment.getExternalStorageDirectory().getPath()+ File.separator+"topvision/c.jpg";
        List<String> photos = new ArrayList<>();
        photos.add(photo1);
        photos.add(photo2);
        photos.add(photo3);
        tvPhotoView = (TvPhotoView) findViewById(R.id.tvPhotoView);
        tvPhotoView.setOnShowPhotoListener(this);
        tvPhotoView.showPhoto(photos);

    }


    @Override
    public void doRight() {
        Log.e(CameraConstants.TAG,"viewpager 向右滑动...");
    }

    @Override
    public void doLeft() {
        Log.e(CameraConstants.TAG,"viewpager 向左滑动...");

    }
}
